package com.dimeng;

import java.io.Serializable;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import com.dimeng.utils.CommonUtil;

/**
 * @author write by ccn<br>
 * <b>helloandroid100@gmail.com</b>
 * @version 0.1;2012-6-12 上午9:49:37<br>
 * descrition:Activity的抽象类
 */
public abstract class SuperActivity extends Activity implements Serializable{
	private static final long serialVersionUID = 666345915984662813L;
	@Override
	public boolean onCreateOptionsMenu(Menu menu){
		MenuInflater menuInflater = getMenuInflater();
		menuInflater.inflate(R.menu.option_menu, menu);
		return super.onCreateOptionsMenu(menu);
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		Intent intent = new Intent();
		switch(item.getItemId()){
			case R.id.exitItemId:
				CommonUtil.exitDialog(this);
				break;
			case R.id.homeItemId:
				intent.setClass(this, TaojindiActivity.class);
				this.startActivity(intent);//跳转到主页
				break;
			case R.id.aboutItemId:
				intent.setClass(this, AboutUsActivity.class);
				this.startActivity(intent);//跳转到关于我们
				break;
			case R.id.suggestionItemId:
				intent.setClass(this, SuggestActivity.class);
				this.startActivity(intent);//跳转到反馈意见
				break;
		}
		return super.onOptionsItemSelected(item);
	}
}
